<?php
	include ('../layout.php');
	Cabecalho();

/*session_start();
require_once "funcoes.php";
//VerificaBase();
VerificaAcesso("usuario.php");

//inclui conexao
include("conexao.php");

$codigo = pg_escape_string($_GET[codigoid]);

if ($codigo > 0) {
	//seleciona os dados
	$select = "
	select codigoid, nome, login, senha, email
	from   usuario
	where  codigoid = '$codigo'
	";
	//echo "<pre>$select</pre>";
	$query = pg_exec($conexao, $select);
	if (pg_num_rows($query) > 0) {
		$dado = pg_fetch_row($query);
		$codigo = $dado[0];
	}
/*
 

}
//echo "<pre>$select</pre>";
*/
?>
<div id="validar"></div>
<script language="javascript" type="text/javascript" src="scripts/validar_generico.js"></script>

<table id="t_dadosp" class="tabela1 dados">
	<tr>
		<td><h4 class="divisao">Cadastro de Usu&aacute;rio</h4></td>
	</tr>
</table>
<form id="frmconsignatario" name="frmconsignatario" action="salvar_usuario.php" onsubmit="return valida(this)" method="post">
<table id="t_dadosp" class="tabela1 dados">
	<tr>
		<td colspan="3">
			<table class="tabela3">
				<tr>
					<th colspan="2">1. Nome</th>
				</tr>
				<tr>
					<td colspan="2"><input type="text" name="nome" class="validar naonulo" alt="Nome" size="25" maxlength="100" value="<?= $dado[1]?>"></td>
				</tr>
				<tr>
					<th>2. Login</th>
					<th>3. Senha</th>
				</tr>
				<tr>
					<td><input type="text" name="login" class="validar naonulo" alt="Login" size="10" maxlength="12" value="<?= $dado[2]?>"></td>
					<td><input type="password" name="senha" class="validar naonulo" alt="Senha" size="10" maxlength="12" value="<?= $dado[3]?>"></td>
				</tr>
				<tr>
					<th colspan="3">4. E-mail</th>
				</tr>
				<tr>
					<td colspan="3"><input type="text" name="email" class="validar" alt="E-mail" size="25" maxlength="200" value="<?= $dado[4]?>"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
<table id="t_dadosp" class="tabela1 dados">
	<tr>
		<td colspan="3">
			<p class="tcen">
				<input type="hidden" name="codigoid" value="<?=$dado[0]?>" class="input-button" />
				<input type="submit" value="Salvar" class="input-button" />
			</p>
		</td>
	</tr>

</table>
</form>
<div id="recarrega_ajax"></div>

<? Rodape(); ?>